//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Research.DataLayer.Properties;

namespace Microsoft.Research.DataLayer
{
    internal partial class ConnMgrDlg_Save : Form
    {
        public ConnMgrDlg_Save()
        {
            InitializeComponent();
        }

        internal string SaveAs
        {
            get { return saveName.Text.Trim(); }
        }

        private void ConnMgrDlg_Save_Load(object sender, EventArgs e)
        {

        }

        private void ok_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(saveName.Text.Trim()))////Check if the connection preset name is empty/only spaces
            {
                MessageBox.Show(this, Resources.EmptyPresetConnectionNameMessage, Resources.EmptyPresetConnectionNameTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                saveName.SelectAll();
                saveName.Focus();
                this.DialogResult = DialogResult.None;
            }
            else
            {
                this.DialogResult = DialogResult.OK;
            }
        }
    }
}
